-
Notifications
You must be signed in to change notification settings - Fork 65
network: add network integration with NetworkManager backend #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Why are we linking nm? Should be entirely over dbus |
This reverts commit 8679f79.
NMWireless will be a property of Device (if DeviceType==Wifi). In the future if many org.freedesktop.networkmanager.Device.* are implemented, we can use the factory pattern to create an NMDevice with its subdevice properties and methods.
|
I'm not sure what stage of development you're at here and haven't checked code yet, but just so we're clear I'd like to expose this under I don't think I've made that clear so far. (If you've got any questions, @ me here or in the matrix/discord) |
9d41148 to
4b35d7b
Compare
525a933 to
bb206e3
Compare
a92879d to
9bb2c04
Compare
|
@bbedward Would love your feedback on this API. Besides the obvious missing features, does the design make anything difficult for DMS? |
It looks pretty consistent with quickshell conventions to me. I'd like to see the agent/connection manager, but it's not necessary for the initial integration IMO (the bluez implementation doesn't have an agent either) |
outfoxxed
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I wasn't able to do a full review today, but I think I got most of the interface. These changes don't necessarily have to be made if you've got a good reason not to though.
|
Resolved all but scan |
A few changes to the frontend Network API: - Expose all devices at the toplevel - Move wifi rfkill options to the toplevel - Add WifiSecurityType (backend agnostic) - Move WifiNetwork signal strength to a qreal from 0.0 to 1.0 - Add extensible BaseNetwork class
|
Made an attempt at WifiScanner following the KDE implementation. Requires deprecated header |
- Add WifiScanner to replace requestScan in API - Implement NM scanner that avoids rate limit - Add conditional visibility to networks based on scanner state - Add gates to backend-specific props in the manual test
- Add WifiDeviceMode and WifiDevice.mode - Add module.md - Reimplement NMWirelessNetwork - Fix mode checking for NMWirelessDevice onConnectionLoaded/onAccessPointLoaded - Move security type to bindings in NMAccessPoint and NMConnectionSettings
|
Sorry I haven't looked at this recently, is it ready for review again? |
|
@outfoxxed Yep! I decided to keep WifiNetwork as a group of all access points and connection settings for a given SSID. KDE shows a network item PER conn settings, which makes sense because its only backend (NM) is connection centric. But I think 99% of use is connecting to a network which only has one conn settings. IWD doesn't even allow multiple. Right now, if theres multiple it attempts a connection using the best settings (highest security). Eventually we'd want to expose the AccessPoint(s) and ConnSetting(s) (only one for IWD) under these networks and expand the connect() function to optionally take a specific AP or settings. This gives feature parity with the NM API for the 1% who actually use multiple settings. A connection editor and these extensions to WifiNetwork would be a large feature so I was hoping to get the basics merged before that. The biggest issue with not including ConnSetting initially is losing a forget() function that removes the setting. Does a forget() at the WifiNetwork level that deletes ALL its associated settings suffice for now? |
| ///! Scans for available wifi networks. | ||
| /// When enabled, the scanner populates its respective WifiDevice with an active list of available WifiNetworks. | ||
| class WifiScanner: public QObject { | ||
| Q_OBJECT; | ||
| QML_ELEMENT; | ||
| QML_UNCREATABLE("Scanner can only be acquired through WifiDevice"); | ||
|
|
||
| // clang-format off | ||
| /// True when currently scanning for networks. | ||
| Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged BINDABLE bindableEnabled); | ||
| // clang-format on | ||
|
|
||
| public: | ||
| explicit WifiScanner(QObject* parent = nullptr); | ||
|
|
||
| QBindable<bool> bindableEnabled() { return &this->bEnabled; }; | ||
| [[nodiscard]] bool enabled() const { return this->bEnabled; }; | ||
| void setEnabled(bool enabled); | ||
|
|
||
| signals: | ||
| void enabledChanged(bool enabled); | ||
|
|
||
| private: | ||
| Q_OBJECT_BINDABLE_PROPERTY(WifiScanner, bool, bEnabled, &WifiScanner::enabledChanged); | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can reduce to a bool property unless there's more functionality to add?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point yeah
outfoxxed
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I've taken so long to get back to you on this one in general.
Got a coredump trying to sw disable my wifi radio in the tester, or via rfkill with the tester open (notably enable is fine):
(gdb) bt
#0 0x00007f050ec2b66f in void doActivate<false>(QObject*, int, void**) () from /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6
#1 0x00007f050ec2ed23 in QPropertyBindingPrivate::notifyNonRecursive() () from /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6
#2 0x00007f050ec32e88 in QtPrivate::QPropertyBindingData::notifyObservers(QUntypedPropertyData*, QBindingStorage*) const () from /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6
#3 0x000055c45f80fc1a in QObjectBindableProperty<qs::network::NMWirelessNetwork, qs::network::NMConnectionState::Enum, &qs::network::NMWirelessNetwork::_qt_property_bState_offset, &qs::network::NMWirelessNetwork::stateChanged>::notify (this=0x7f0507e0d594, binding=<optimized out>) at /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qproperty.h:1280
#4 QObjectBindableProperty<qs::network::NMWirelessNetwork, qs::network::NMConnectionState::Enum, &qs::network::NMWirelessNetwork::_qt_property_bState_offset, &qs::network::NMWirelessNetwork::stateChanged>::setValue (this=this@entry=0x7f0507e0d594, t=t@entry=qs::network::NMConnectionState::Deactivated) at /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qproperty.h:1161
#5 0x000055c45f809ffa in QObjectBindableProperty<qs::network::NMWirelessNetwork, qs::network::NMConnectionState::Enum, &qs::network::NMWirelessNetwork::_qt_property_bState_offset, &qs::network::NMWirelessNetwork::stateChanged>::operator= (this=0xffffffffffffffd8, newValue=qs::network::NMConnectionState::Deactivated) at /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qproperty.h:1188
#6 qs::network::NMWirelessNetwork::addActiveConnection(qs::network::NMActiveConnection*)::$_2::operator()() const (this=<optimized out>) at /home/admin/programming/outfoxxed/quickshell/src/network/nm/wireless.cpp:154
#7 QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, qs::network::NMWirelessNetwork::addActiveConnection(qs::network::NMActiveConnection*)::$_2>::call(qs::network::NMWirelessNetwork::addActiveConnection(qs::network::NMActiveConnection*)::$_2&, void**)::{lambda()#1}::operator()() const (this=<optimized out>) at /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qobjectdefs_impl.h:116
#8 QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, qs::network::NMWirelessNetwork::addActiveConnection(qs::network::NMActiveConnection*)::$_2>::call(qs::network::NMWirelessNetwork::addActiveConnection(qs::network::NMActiveConnection*)::$_2&, void**)::{lambda()#1}>(void**, QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, qs::network::NMWirelessNetwork::addActiveConnection(qs::network::NMActiveConnection*)::$_2>::call(qs::network::NMWirelessNetwork::addActiveConnection(qs::network::NMActiveConnection*)::$_2&, void**)::{lambda()#1}&&) (args=<optimized out>, fn=...) at /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qobjectdefs_impl.h:65
#9 QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, qs::network::NMWirelessNetwork::addActiveConnection(qs::network::NMActiveConnection*)::$_2>::call(qs::network::NMWirelessNetwork::addActiveConnection(qs::network::NMActiveConnection*)::$_2&, void**) (f=..., arg=<optimized out>) at /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qobjectdefs_impl.h:115
#10 QtPrivate::FunctorCallable<qs::network::NMWirelessNetwork::addActiveConnection(qs::network::NMActiveConnection*)::$_2>::call<QtPrivate::List<>, void>(qs::network::NMWirelessNetwork::addActiveConnection(qs::network::NMActiveConnection*)::$_2&, void*, void**) (f=..., arg=<optimized out>) at /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qobjectdefs_impl.h:337
#11 QtPrivate::QCallableObject<qs::network::NMWirelessNetwork::addActiveConnection(qs::network::NMActiveConnection*)::$_2, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=<optimized out>, this_=<optimized out>, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qobjectdefs_impl.h:547
#12 0x00007f050ec2bd3e in void doActivate<false>(QObject*, int, void**) () from /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6
#13 0x000055c45f7fdda3 in qs::network::NMDevice::onActiveConnectionPathChanged (this=0x7f04ee011680, path=...) at /home/admin/programming/outfoxxed/quickshell/src/network/nm/device.cpp:55
#14 0x00007f050ec2bd3e in void doActivate<false>(QObject*, int, void**) () from /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6
#15 0x000055c45f7e1f16 in QMetaObject::activate<void, QDBusObjectPath> (sender=0xffffffffffffffd8, mo=0x3, local_signal_index=5, ret=0x0, args=...) at /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qobjectdefs.h:319
#16 qs::network::NMDevice::activeConnectionPathChanged (this=0xffffffffffffffd8, _t1=...) at src/network/quickshell-network_autogen/Q3TV7WUJSF/moc_device.cpp:335
#17 0x000055c45f80088a in qs::dbus::DBusBindableProperty<void, &qs::network::NMDevice::_qs_property_pActiveConnection_offset, &qs::network::NMDevice::bActiveConnection, (decltype(nullptr))0, &qs::network::NMDevice::deviceProperties, StringLiteral16<17ul>{char16_t [17]{(char16_t)65, (char16_t)99, (char16_t)116, (char16_t)105, (char16_t)118, (char16_t)101, (char16_t)67, (char16_t)111, (char16_t)110, (char16_t)110, (char16_t)101, (char16_t)99, (char16_t)116, (char16_t)105, (char16_t)111, (char16_t)110}}, true>::store(QVariant const&) (this=<optimized out>,
variant=...) at /home/admin/programming/outfoxxed/quickshell/src/network/nm/../../dbus/properties.hpp:199
#18 0x000055c45f81e454 in qs::dbus::DBusPropertyGroup::tryUpdateProperty (this=this@entry=0x7f04ee011710, property=0x3, variant=...) at /home/admin/programming/outfoxxed/quickshell/src/dbus/properties.cpp:223
#19 0x000055c45f81df20 in qs::dbus::DBusPropertyGroup::updatePropertySet (this=this@entry=0x7f04ee011710, properties=..., complainMissing=false) at /home/admin/programming/outfoxxed/quickshell/src/dbus/properties.cpp:203
#20 0x000055c45f81d047 in qs::dbus::DBusPropertyGroup::onPropertiesChanged (this=0x7f04ee011710, interfaceName=..., changedProperties=..., invalidatedProperties=...) at /home/admin/programming/outfoxxed/quickshell/src/dbus/properties.cpp:334
#21 0x00007f050ec2bd3e in void doActivate<false>(QObject*, int, void**) () from /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6
#22 0x000055c45f827bc8 in QMetaObject::activate<void, QString, QMap<QString, QVariant>, QList<QString> > (sender=0xffffffffffffffd8, sender@entry=0x7f050a5d1b00, mo=0x3, local_signal_index=0, ret=0x0, args=..., args=..., args=...) at /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qobjectdefs.h:319
#23 DBusPropertiesInterface::PropertiesChanged (this=0xffffffffffffffd8, this@entry=0x7f050a5d1b00, _t3=..., _t1=..., _t2=...) at src/dbus/moc_dbus_properties.cpp:149
#24 DBusPropertiesInterface::qt_static_metacall (_o=0xffffffffffffffd8, _o@entry=0x7f050a5d1b00, _c=_c@entry=QMetaObject::InvokeMetaMethod, _id=<optimized out>, _a=<optimized out>) at src/dbus/moc_dbus_properties.cpp:99
#25 0x000055c45f827dad in DBusPropertiesInterface::qt_metacall (this=0x7f050a5d1b00, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x0) at src/dbus/moc_dbus_properties.cpp:135
#26 0x00007f050fd7295e in QDBusConnectionPrivate::deliverCall(QObject*, QDBusMessage const&, QList<QMetaType> const&, int) () from /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6DBus.so.6
#27 0x00007f050ec1cafa in QObject::event(QEvent*) () from /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6
#28 0x00007f050ebbd0c8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6
#29 0x00007f050ebc086d in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6
#30 0x00007f050eefcfbf in postEventSourceDispatch(_GSource*, int (*)(void*), void*) () from /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6
#31 0x00007f05116709ed in g_main_dispatch (context=0x7f050a4692a0) at ../glib/gmain.c:3565
#32 g_main_context_dispatch_unlocked (context=context@entry=0x7f050a4692a0) at ../glib/gmain.c:4425
#33 0x00007f0511673e78 in g_main_context_iterate_unlocked (context=context@entry=0x7f050a4692a0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4490
#34 0x00007f051167470f in g_main_context_iteration (context=0x7f050a4692a0, may_block=1) at ../glib/gmain.c:4556
#35 0x00007f050eefc673 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6
#36 0x00007f050ebcae93 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6
#37 0x00007f050ebc5d81 in QCoreApplication::exec() () from /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6
#38 0x000055c45f4d5460 in qs::launch::launch (args=..., argv=0x7fff422e2348, coreApplication=coreApplication@entry=0x7f050a418820) at /home/admin/programming/outfoxxed/quickshell/src/launch/launch.cpp:260
#39 0x000055c45f4ca21b in qs::launch::(anonymous namespace)::launchFromCommand (cmd=..., coreApplication=coreApplication@entry=0x7f050a418820) at /home/admin/programming/outfoxxed/quickshell/src/launch/command.cpp:442
#40 0x000055c45f4c816e in qs::launch::runCommand (argc=argc@entry=3, argv=argv@entry=0x7fff422e2348, coreApplication=coreApplication@entry=0x7f050a418820) at /home/admin/programming/outfoxxed/quickshell/src/launch/command.cpp:550
#41 0x000055c45f4c09e6 in qs::launch::main (argc=3, argv=0x7fff422e2348) at /home/admin/programming/outfoxxed/quickshell/src/launch/main.cpp:115
#42 0x00007f050e22a4d8 in __libc_start_call_main (main=main@entry=0x55c45f4bffa0 <main(int, char**)>, argc=argc@entry=3, argv=argv@entry=0x7fff422e2348) at ../sysdeps/nptl/libc_start_call_main.h:58
#43 0x00007f050e22a59b in __libc_start_main_impl (main=0x55c45f4bffa0 <main(int, char**)>, argc=3, argv=0x7fff422e2348, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff422e2338) at ../csu/libc-start.c:360
#44 0x000055c45f4be425 in _start ()
AddressSanitizer:DEADLYSIGNAL
=================================================================
==45800==ERROR: AddressSanitizer: SEGV on unknown address 0xffffffffffffffe0 (pc 0x7fe96c62b66f bp 0x7ffc8da725d0 sp 0x7ffc8da724f0 T0)
==45800==The signal is caused by a READ memory access.
#0 0x7fe96c62b66f in void doActivate<false>(QObject*, int, void**) (/nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6+0x22b66f) (BuildId: de7c3bf683f8e26710248e06d909c953b3c03f97)
#1 0x7fe96c62ed22 in QPropertyBindingPrivate::notifyNonRecursive() (/nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6+0x22ed22) (BuildId: de7c3bf683f8e26710248e06d909c953b3c03f97)
#2 0x7fe96c632e87 in QtPrivate::QPropertyBindingData::notifyObservers(QUntypedPropertyData*, QBindingStorage*) const (/nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6+0x232e87) (BuildId: de7c3bf683f8e26710248e06d909c953b3c03f97)
#3 0x55db258da96a in QObjectBindableProperty<qs::network::NMWirelessNetwork, qs::network::NMConnectionState::Enum, &qs::network::NMWirelessNetwork::_qt_property_bState_offset, &qs::network::NMWirelessNetwork::stateChanged>::notify(QtPrivate::QPropertyBindingData const*) /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qproperty.h:1280
#4 0x55db258da96a in QObjectBindableProperty<qs::network::NMWirelessNetwork, qs::network::NMConnectionState::Enum, &qs::network::NMWirelessNetwork::_qt_property_bState_offset, &qs::network::NMWirelessNetwork::stateChanged>::setValue(qs::network::NMConnectionState::Enum) /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qproperty.h:1161
#5 0x55db258da96a in QObjectBindableProperty<qs::network::NMWirelessNetwork, qs::network::NMConnectionState::Enum, &qs::network::NMWirelessNetwork::_qt_property_bState_offset, &qs::network::NMWirelessNetwork::stateChanged>::operator=(qs::network::NMConnectionState::Enum) /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qproperty.h:1188
#6 0x55db258da96a in operator() /home/admin/programming/outfoxxed/quickshell/src/network/nm/wireless.cpp:154
#7 0x55db258da96a in operator() /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qobjectdefs_impl.h:116
#8 0x55db258da96a in call_internal<void, QtPrivate::FunctorCall<std::integer_sequence<long unsigned int>, QtPrivate::List<>, void, qs::network::NMWirelessNetwork::addActiveConnection(qs::network::NMActiveConnection*)::<lambda()> >::call(qs::network::NMWirelessNetwork::addActiveConnection(qs::network::NMActiveConnection*)::<lambda()>&, void**)::<lambda()> > /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qobjectdefs_impl.h:65
#9 0x55db258da96a in call /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qobjectdefs_impl.h:115
#10 0x55db258da96a in call<QtPrivate::List<>, void> /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qobjectdefs_impl.h:337
#11 0x55db258da96a in impl /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qobjectdefs_impl.h:547
#12 0x7fe96c62bd3d in void doActivate<false>(QObject*, int, void**) (/nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6+0x22bd3d) (BuildId: de7c3bf683f8e26710248e06d909c953b3c03f97)
#13 0x55db2589ce00 in qs::network::NMDevice::onActiveConnectionPathChanged(QDBusObjectPath const&) /home/admin/programming/outfoxxed/quickshell/src/network/nm/device.cpp:55
#14 0x55db258a40a7 in QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul>, QtPrivate::List<QDBusObjectPath const&>, void, void (qs::network::NMDevice::*)(QDBusObjectPath const&)>::call(void (qs::network::NMDevice::*)(QDBusObjectPath const&), qs::network::NMDevice*, void**)::{lambda()#1}::operator()() const /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qobjectdefs_impl.h:127
#15 0x55db258a40a7 in void QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul>, QtPrivate::List<QDBusObjectPath const&>, void, void (qs::network::NMDevice::*)(QDBusObjectPath const&)>::call(void (qs::network::NMDevice::*)(QDBusObjectPath const&), qs::network::NMDevice*, void**)::{lambda()#1}>(void**, QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul>, QtPrivate::List<QDBusObjectPath const&>, void, void (qs::network::NMDevice::*)(QDBusObjectPath const&)>::call(void (qs::network::NMDevice::*)(QDBusObjectPath const&), qs::network::NMDevice*, void**)::{lambda()#1}&&) /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qobjectdefs_impl.h:65
#16 0x55db258a40a7 in QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul>, QtPrivate::List<QDBusObjectPath const&>, void, void (qs::network::NMDevice::*)(QDBusObjectPath const&)>::call(void (qs::network::NMDevice::*)(QDBusObjectPath const&), qs::network::NMDevice*, void**) /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qobjectdefs_impl.h:126
#17 0x55db258a40a7 in void QtPrivate::FunctionPointer<void (qs::network::NMDevice::*)(QDBusObjectPath const&)>::call<QtPrivate::List<QDBusObjectPath const&>, void>(void (qs::network::NMDevice::*)(QDBusObjectPath const&), qs::network::NMDevice*, void**) /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qobjectdefs_impl.h:174
#18 0x55db258a40a7 in QtPrivate::QCallableObject<void (qs::network::NMDevice::*)(QDBusObjectPath const&), QtPrivate::List<QDBusObjectPath const&>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qobjectdefs_impl.h:545
#19 0x7fe96c62bd3d in void doActivate<false>(QObject*, int, void**) (/nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6+0x22bd3d) (BuildId: de7c3bf683f8e26710248e06d909c953b3c03f97)
#20 0x55db25823fd6 in void QMetaObject::activate<void, QDBusObjectPath>(QObject*, QMetaObject const*, int, void*, QDBusObjectPath const&) /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qobjectdefs.h:319
#21 0x55db25823fd6 in qs::network::NMDevice::activeConnectionPathChanged(QDBusObjectPath const&) /home/admin/programming/outfoxxed/quickshell/build/src/network/quickshell-network_autogen/Q3TV7WUJSF/moc_device.cpp:335
#22 0x55db258b6bd3 in QObjectBindableProperty<qs::network::NMDevice, QDBusObjectPath, &qs::network::NMDevice::_qt_property_bActiveConnection_offset, &qs::network::NMDevice::activeConnectionPathChanged>::notify(QtPrivate::QPropertyBindingData const*) /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qproperty.h:1283
#23 0x55db258b6bd3 in QObjectBindableProperty<qs::network::NMDevice, QDBusObjectPath, &qs::network::NMDevice::_qt_property_bActiveConnection_offset, &qs::network::NMDevice::activeConnectionPathChanged>::setValue(QDBusObjectPath&&) /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qproperty.h:1177
#24 0x55db258b6bd3 in qs::dbus::DBusBindableProperty<void, &qs::network::NMDevice::_qs_property_pActiveConnection_offset, &qs::network::NMDevice::bActiveConnection, decltype(nullptr), &qs::network::NMDevice::deviceProperties, StringLiteral16<17ul>{char16_t [17]{(char16_t)65, (char16_t)99, (char16_t)116, (char16_t)105, (char16_t)118, (char16_t)101, (char16_t)67, (char16_t)111, (char16_t)110, (char16_t)110, (char16_t)101, (char16_t)99, (char16_t)116, (char16_t)105, (char16_t)111, (char16_t)110}}, true>::store(QVariant const&) /home/admin/programming/outfoxxed/quickshell/src/network/nm/../../dbus/properties.hpp:199
#25 0x55db25938f95 in qs::dbus::DBusPropertyGroup::tryUpdateProperty(qs::dbus::DBusPropertyCore*, QVariant const&) const /home/admin/programming/outfoxxed/quickshell/src/dbus/properties.cpp:223
#26 0x55db25941c74 in qs::dbus::DBusPropertyGroup::updatePropertySet(QMap<QString, QVariant> const&, bool) /home/admin/programming/outfoxxed/quickshell/src/dbus/properties.cpp:203
#27 0x55db25949465 in qs::dbus::DBusPropertyGroup::onPropertiesChanged(QString const&, QMap<QString, QVariant> const&, QList<QString> const&) /home/admin/programming/outfoxxed/quickshell/src/dbus/properties.cpp:334
#28 0x55db25951e66 in QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul, 1ul, 2ul>, QtPrivate::List<QString const&, QMap<QString, QVariant> const&, QList<QString> const&>, void, void (qs::dbus::DBusPropertyGroup::*)(QString const&, QMap<QString, QVariant> const&, QList<QString> const&)>::call(void (qs::dbus::DBusPropertyGroup::*)(QString const&, QMap<QString, QVariant> const&, QList<QString> const&), qs::dbus::DBusPropertyGroup*, void**)::{lambda()#1}::operator()() const /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qobjectdefs_impl.h:127
#29 0x55db25951e66 in void QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul, 1ul, 2ul>, QtPrivate::List<QString const&, QMap<QString, QVariant> const&, QList<QString> const&>, void, void (qs::dbus::DBusPropertyGroup::*)(QString const&, QMap<QString, QVariant> const&, QList<QString> const&)>::call(void (qs::dbus::DBusPropertyGroup::*)(QString const&, QMap<QString, QVariant> const&, QList<QString> const&), qs::dbus::DBusPropertyGroup*, void**)::{lambda()#1}>(void**, QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul, 1ul, 2ul>, QtPrivate::List<QString const&, QMap<QString, QVariant> const&, QList<QString> const&>, void, void (qs::dbus::DBusPropertyGroup::*)(QString const&, QMap<QString, QVariant> const&, QList<QString> const&)>::call(void (qs::dbus::DBusPropertyGroup::*)(QString const&, QMap<QString, QVariant> const&, QList<QString> const&), qs::dbus::DBusPropertyGroup*, void**)::{lambda()#1}&&) /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qobjectdefs_impl.h:65
#30 0x55db25951e66 in QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul, 1ul, 2ul>, QtPrivate::List<QString const&, QMap<QString, QVariant> const&, QList<QString> const&>, void, void (qs::dbus::DBusPropertyGroup::*)(QString const&, QMap<QString, QVariant> const&, QList<QString> const&)>::call(void (qs::dbus::DBusPropertyGroup::*)(QString const&, QMap<QString, QVariant> const&, QList<QString> const&), qs::dbus::DBusPropertyGroup*, void**) /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qobjectdefs_impl.h:126
#31 0x55db25951e66 in void QtPrivate::FunctionPointer<void (qs::dbus::DBusPropertyGroup::*)(QString const&, QMap<QString, QVariant> const&, QList<QString> const&)>::call<QtPrivate::List<QString const&, QMap<QString, QVariant> const&, QList<QString> const&>, void>(void (qs::dbus::DBusPropertyGroup::*)(QString const&, QMap<QString, QVariant> const&, QList<QString> const&), qs::dbus::DBusPropertyGroup*, void**) /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qobjectdefs_impl.h:174
#32 0x55db25951e66 in QtPrivate::QCallableObject<void (qs::dbus::DBusPropertyGroup::*)(QString const&, QMap<QString, QVariant> const&, QList<QString> const&), QtPrivate::List<QString const&, QMap<QString, QVariant> const&, QList<QString> const&>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qobjectdefs_impl.h:545
#33 0x7fe96c62bd3d in void doActivate<false>(QObject*, int, void**) (/nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6+0x22bd3d) (BuildId: de7c3bf683f8e26710248e06d909c953b3c03f97)
#34 0x55db25976aaa in void QMetaObject::activate<void, QString, QMap<QString, QVariant>, QList<QString> >(QObject*, QMetaObject const*, int, void*, QString const&, QMap<QString, QVariant> const&, QList<QString> const&) /nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/include/QtCore/qobjectdefs.h:319
#35 0x55db25976aaa in DBusPropertiesInterface::PropertiesChanged(QString const&, QMap<QString, QVariant> const&, QList<QString> const&) /home/admin/programming/outfoxxed/quickshell/build/src/dbus/moc_dbus_properties.cpp:149
#36 0x55db25977089 in DBusPropertiesInterface::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) /home/admin/programming/outfoxxed/quickshell/build/src/dbus/moc_dbus_properties.cpp:99
#37 0x55db25977441 in DBusPropertiesInterface::qt_metacall(QMetaObject::Call, int, void**) /home/admin/programming/outfoxxed/quickshell/build/src/dbus/moc_dbus_properties.cpp:135
#38 0x7fe96e43a95d in QDBusConnectionPrivate::deliverCall(QObject*, QDBusMessage const&, QList<QMetaType> const&, int) (/nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6DBus.so.6+0x5195d) (BuildId: 293ace9d9329633c64089e7faaad432a526eb0c1)
#39 0x7fe96c61caf9 in QObject::event(QEvent*) (/nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6+0x21caf9) (BuildId: de7c3bf683f8e26710248e06d909c953b3c03f97)
#40 0x7fe96c5bd0c7 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6+0x1bd0c7) (BuildId: de7c3bf683f8e26710248e06d909c953b3c03f97)
#41 0x7fe96c5c086c in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (/nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6+0x1c086c) (BuildId: de7c3bf683f8e26710248e06d909c953b3c03f97)
#42 0x7fe96c8fcfbe in postEventSourceDispatch(_GSource*, int (*)(void*), void*) (/nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6+0x4fcfbe) (BuildId: de7c3bf683f8e26710248e06d909c953b3c03f97)
#43 0x7fe96ef019ec in g_main_context_dispatch_unlocked (/nix/store/knb190fxibhkskgnrabrd0rs3xg55l8f-glib-2.86.1/lib/libglib-2.0.so.0+0x629ec) (BuildId: 1a1247b7b292b636b11cd0babbb85253c50694a3)
#44 0x7fe96ef04e77 in g_main_context_iterate_unlocked.isra.0 (/nix/store/knb190fxibhkskgnrabrd0rs3xg55l8f-glib-2.86.1/lib/libglib-2.0.so.0+0x65e77) (BuildId: 1a1247b7b292b636b11cd0babbb85253c50694a3)
#45 0x7fe96ef0570e in g_main_context_iteration (/nix/store/knb190fxibhkskgnrabrd0rs3xg55l8f-glib-2.86.1/lib/libglib-2.0.so.0+0x6670e) (BuildId: 1a1247b7b292b636b11cd0babbb85253c50694a3)
#46 0x7fe96c8fc672 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (/nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6+0x4fc672) (BuildId: de7c3bf683f8e26710248e06d909c953b3c03f97)
#47 0x7fe96c5cae92 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (/nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6+0x1cae92) (BuildId: de7c3bf683f8e26710248e06d909c953b3c03f97)
#48 0x7fe96c5c5d80 in QCoreApplication::exec() (/nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6+0x1c5d80) (BuildId: de7c3bf683f8e26710248e06d909c953b3c03f97)
#49 0x55db24b714b0 in qs::launch::launch(qs::launch::LaunchArgs const&, char**, QCoreApplication*) /home/admin/programming/outfoxxed/quickshell/src/launch/launch.cpp:260
#50 0x55db24b56ec2 in launchFromCommand /home/admin/programming/outfoxxed/quickshell/src/launch/command.cpp:442
#51 0x55db24b56ec2 in qs::launch::runCommand(int, char**, QCoreApplication*) /home/admin/programming/outfoxxed/quickshell/src/launch/command.cpp:550
#52 0x55db24b1070c in qs::launch::main(int, char**) /home/admin/programming/outfoxxed/quickshell/src/launch/main.cpp:115
#53 0x7fe96bc2a4d7 in __libc_start_call_main (/nix/store/rcp9sdrrq8sfxkm5zdykglx7hd2gzbfy-glibc-2.40-66/lib/libc.so.6+0x2a4d7) (BuildId: bb823ec178dd03090f245536ba318f8d8bfb854f)
#54 0x7fe96bc2a59a in __libc_start_main_alias_1 (/nix/store/rcp9sdrrq8sfxkm5zdykglx7hd2gzbfy-glibc-2.40-66/lib/libc.so.6+0x2a59a) (BuildId: bb823ec178dd03090f245536ba318f8d8bfb854f)
#55 0x55db24b15a44 in _start (/home/admin/programming/outfoxxed/quickshell/build/src/quickshell+0x230a44) (BuildId: 3c92094d2cf2fe489e2177982d960570518e5eae)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/nix/store/4pycc2zia7d6ggldfaw0m63ny5479zr4-qtbase-6.10.0/lib/libQt6Core.so.6+0x22b66f) (BuildId: de7c3bf683f8e26710248e06d909c953b3c03f97) in void doActivate<false>(QObject*, int, void**)
==45800==ABORTING
Note: randomly crashed from the same thing after not touching it for 5 minutes.
Noticing also we don't have the ability to forget a known network.
| /// Switch for the rfkill hardware block of all wireless devices. | ||
| Q_PROPERTY(bool wifiHardwareEnabled READ wifiHardwareEnabled NOTIFY wifiHardwareEnabledChanged BINDABLE bindableWifiHardwareEnabled); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't call this a switch if its readonly
| if (this->bWifiEnabled == enabled) { | ||
| const QString state = enabled ? "enabled" : "disabled"; | ||
| qCCritical(logNetwork) << "Wifi is already globally software" << state; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate sets are somewhat expected to happen, just ignore them
| /// Connection state of the device. | ||
| Q_PROPERTY(qs::network::DeviceConnectionState::Enum state READ state NOTIFY stateChanged BINDABLE bindableState); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A "connected" property that just binds to the state and does an eq would be useful
| NetworkDevice::NetworkDevice(DeviceType::Enum type, QObject* parent) | ||
| : QObject(parent) | ||
| , mType(type) {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can go in the header
| /// A list of this available and connected wifi networks. | ||
| Q_PROPERTY(UntypedObjectModel* networks READ networks CONSTANT); | ||
| QSDOC_TYPE_OVERRIDE(ObjectModel<WifiNetwork>*) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are completely ignoring wired networks which nm supports by putting this in the device layer, but I think we've already talked about this, and its acceptable even without them for now. Just pointing out that I can enable/disable a wired connection, though I'm not sure if you can do anything more fine grained than that.
| auto* temp = new QDBusInterface( | ||
| "org.freedesktop.NetworkManager", | ||
| path, | ||
| "org.freedesktop.DBus.Properties", | ||
| QDBusConnection::systemBus(), | ||
| this | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
asyncReadProperty from dbus/properties.hpp may be nicer
|
|
||
| switch (type) { | ||
| case NMDeviceType::Wifi: dev = new NMWirelessDevice(path); break; | ||
| default: return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return without deleting call, same with following returns. Probably wrap this / use asyncReadProperty as mentioned above which deletes the callback
| }; | ||
| // clang-format off | ||
| QObject::connect(ap, &NMAccessPoint::signalStrengthChanged, this, &NMWirelessNetwork::updateReferenceAp); | ||
| QObject::connect(ap, &NMAccessPoint::disappeared, this, onDisappeared); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can an AP be destroyed without disappeared?
| }; | ||
| // clang-format off | ||
| QObject::connect(conn, &NMConnectionSettings::securityChanged, this, &NMWirelessNetwork::updateReferenceConnection); | ||
| QObject::connect(conn, &NMConnectionSettings::disappeared, this, onDisappeared); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
| this->bReason = NMConnectionStateReason::None; | ||
| } | ||
| }; | ||
| QObject::connect(active, &NMActiveConnection::disappeared, this, onDisappeared); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
etc
Adds basic support for listing wifi devices and networks and attempting a connection. Missing support for connections that require an agent.
Closes #74.